package com.obtk.shilipai.service;

import com.obtk.shilipai.dao.DisheMapper;
import com.obtk.shilipai.entity.Dishe;
import com.obtk.shilipai.entity.DisheType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DisheService {
    @Autowired
    private DisheMapper disheMapper;

    public List<Dishe> getDisheByAll(Integer shopId, Integer disheTypeId, Integer status, String keywords) {
        return disheMapper.getDisheByAll(shopId,disheTypeId,status,keywords);
    }

    public Integer addDishe(Dishe dishe) {
        return disheMapper.addDishe(dishe);
    }

    public List<DisheType> getDisheType(Integer shopId) {

        return disheMapper.getDisheType(shopId);
    }

    public Integer addDisheType(DisheType disheType) {
        return disheMapper.addDisheType(disheType);
    }

    public Integer delDisheType(String[] idStr) {
        return disheMapper.delDisheType(idStr);
    }

    public Integer delDishe(String[] idStr) {
        return disheMapper.delDishe(idStr);
    }

    public Dishe getDisheById(Integer disheId) {
        return disheMapper.getDisheById(disheId);
    }


    public Integer updateDishe(Dishe dishe){
        return disheMapper.updateDishe(dishe);
    }

    public Integer xiajiaDishe(String[] idArray) {
        return disheMapper.xiajiaDishe(idArray);
    }

    public Integer shangjiaDishe(String[] idArray) {
        return disheMapper.shangjiaDishe(idArray);
    }

    public List<DisheType> getDisheNum() {

        return disheMapper.getDisheNum();
    }

    public Integer setDisheNum(Integer disheTypeId, Integer disheNum) {
        return disheMapper.setDisheNum(disheTypeId,disheNum);
    }

    public List<Dishe> getDisheByShopId(Integer shopId) {
        return disheMapper.getDisheByShopId(shopId);
    }
}
